//
//  BLLeftTableViewCell.m
//  百思不得姐
//
//  Created by hbl on 16/3/16.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLLeftTableViewCell.h"
#import "BLClassify.h"

@interface BLLeftTableViewCell()
@property (weak, nonatomic) IBOutlet UIView *leftView;

@end

@implementation BLLeftTableViewCell

- (void)awakeFromNib {
    // Initialization code
    self.backgroundColor = BLColor(240, 240, 240);

}

- (void)setClassify:(BLClassify *)classify
{
    _classify = classify;
    self.textLabel.text = classify.name;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.textLabel.frame = CGRectMake(self.textLabel.frame.origin.x + 2, self.textLabel.frame.origin.y, self.textLabel.frame.size.width, self.textLabel.frame.size.height - 4);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
    self.leftView.hidden = !selected;
    self.textLabel.textColor = !selected ? BLColor(39, 39, 39):[UIColor redColor];
}

@end
